from app import *

class Respon():
    """
    返回类型类
    """
    def __init__(self):
        pass

    @classmethod
    def rjson(self,data={},headers={}):
        # 以json类型返回
        res = Response()
        res.headers = headers
        res.headers['Content-Type'] = 'application/json'
        res.data = json.dumps(data, ensure_ascii=False)
        return res

    @classmethod
    def not_find_404(self):
        # 返回404 错误
        res = Response()
        res.status_code = 404
        return res